/******************************************************************************
 * * mmi_modemadp_interface.h
 *
 * *(C) Copyright 2019 Asr International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#ifndef _MMI_MODEMADP_INTERFACE_H_
#define _MMI_MODEMADP_INTERFACE_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cpluscplus */

typedef enum
{
    MMI_MODEM_SIM_1 = 0,
    MMI_MODEM_SIM_2
} MMI_MODEM_SIM_ID;

typedef enum
{
    MMI_MODEM_ERROR = 0,
    MMI_MODEM_SUCCESS
} MMI_MODEM_RESULT;

typedef enum
{
    MMI_MODEM_POWER_OFF = 0,
    MMI_MODEM_SIM_DISABLE,
} MMI_MODEM_POWER_OFF_TYPE;

typedef enum
{
    MMI_MODEM_CALL_STATE_NULL     = 0,
    MMI_MODEM_CALL_STATE_ACTIVE   = 1,
    MMI_MODEM_CALL_STATE_HOLDING  = 2,
    MMI_MODEM_CALL_STATE_DIALING  = 3,                                           /* MO call only */
    MMI_MODEM_CALL_STATE_ALERTING = 4,                                           /* MO call only */
    MMI_MODEM_CALL_STATE_INCOMING = 5,                                           /* MT call only */
    MMI_MODEM_CALL_STATE_WAITING  = 6,                                           /* MT call only */
    MMI_MODEM_CALL_STATE_INVALID  = 0xFF
} MMI_MODEM_CALL_STATE;

typedef struct
{
    MMI_MODEM_SIM_ID     simId;
    MMI_MODEM_CALL_STATE state;

#define MMI_MODEM_CALL_INVALID_INDEX    (-1)                                     /* default index if have not get it from ril */
    int32_t                index;                                                  /* Connection Index for use with, eg, AT+CHLD */
    int32_t                toa;                                                    /* type of address, eg 145 = intl */
    char                 isMpty;                                                 /* nonzero if is mpty call */
    char                 isMT;                                                   /* nonzero if call is mobile terminated */
    char                 als;                                                    /* ALS line indicator if available
                                                                                  * (0 = line 1) */
    char                 isVoice;                                                /* nonzero if this is is a voice call */
    char                 isVoicePrivacy;                                         /* nonzero if CDMA voice privacy mode is active */
    char                 *number;                                                /* Remote party number */
    int32_t                numberPresentation;                                     /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
    char                 *name;                                                  /* Remote party name */
    int32_t                namePresentation;                                       /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
    // RIL_UUS_Info *  uusInfo;                                                  /* NULL or Pointer to User-User Signaling Information */
} MMI_Modem_Call_t;
typedef enum
{
    MMI_MODEM_CALL_SERVICE_NORMAL = 0,
    MMI_MODEM_CALL_SERVICE_EMERGENCY,
} MMI_MODEM_CALL_SERVICE_TYPE;

typedef struct
{
    MMI_Modem_Call_t *calls;
    int32_t            count; /* count of calls */
} MMI_Modem_Call_Rsp_Get_Current_Calls_t;

typedef struct
{
    char  dtmf; /* a single character with one of 12 values: 0-9,*,# */
    int32_t duration;
} MMI_Modem_Call_Request_Dtmf_t;

typedef struct
{
    char  *number;
    int32_t type;
    int32_t class;
} MMI_Modem_Call_Response_Ccwa_t;

typedef struct
{
    MMI_Modem_Call_t *calls;
    int32_t            count; /* count of calls */
} MMI_Modem_Call_Response_State_Change_t;

typedef struct
{
    char  *number;
    int32_t type;
} MMI_Modem_Call_Response_Clip_t;

typedef struct
{
    int32_t mute;
    int32_t error;
} MMI_Modem_Call_Response_Cmut_t;

typedef enum
{
    MMI_MODEM_CALL_FORWARD_NO_CONDITION = 0,                                    // divert all incoming call
    MMI_MODEM_CALL_FORWARD_BUSY,                                                // divert incoming call when busy
    MMI_MODEM_CALL_FORWARD_NOT_REACH,                                           // divert if call can not reach
    MMI_MODEM_CALL_FORWARD_NO_ANSWER,                                           // divert call if no answer
    MMI_MODEM_CALL_FORWARD_CANCEL_All,                                          // used for "Cancel all diverts"
} MMI_MODEM_CALL_FORWARD_TYPE;

typedef struct
{
    MMI_MODEM_CALL_FORWARD_TYPE CallForwardType;
    uint8_t                        CallForwardOn;                                  // true means call divert On
    char                        DestNum[NV_CONTACTS_MAX_NUMBER_LEN];            // phone number divert to
    uint8_t                       NoAnswerDelay;                                  // delay for no answer divert in seconds
} MMI_Modem_Call_Forward_Info_t;

typedef enum
{
    MMI_MODEM_PIN_DISABLED = 0,
    MMI_MODEM_PIN1_REQUIRED,
    MMI_MODEM_PIN2_REQUIRED,
    MMI_MODEM_PIN1_BLOCKED_PUK1_REQUIRED,
    MMI_MODEM_PIN2_BLOCKED_PUK2_REQUIRED,
    MMI_MODEM_PUK1_BLOCKED,
    MMI_MODEM_PUK2_BLOCKED,
} MMI_MODEM_PIN_STATUS_TYPE;

typedef struct
{
    MMI_MODEM_SIM_ID          SimId;
    uint8_t                   SimPresent;                                       // true means SIM inserted.
    MMI_MODEM_PIN_STATUS_TYPE Pin1Status;                                       // Pin status for power up.
} MMI_Modem_Sim_Status_t;

typedef enum
{
    MMI_MODEM_PIN1 = 0,
    MMI_MODEM_PIN2,
    MMI_MODEM_PUK,
    MMI_MODEM_PUK2
} MMI_MODEM_PIN_TYPE;

typedef struct
{
    MMI_MODEM_SIM_ID   SimId;
    MMI_MODEM_PIN_TYPE PinType;                                                 // pin type of operation
    uint8_t            PinEnable;                                               // for setting & query
    uint8_t            RetriesLeft;
} MMI_Modem_Pin_Lock_t;

typedef struct
{
    uint8_t              PinEnable;                                               // 1 is Enable,0 is DISABLE
    uint8_t              RetriesLeft;                                             // for query
} MMI_Modem_Query_Pin_Lock_Info_t;

#define MMI_MODEM_PIN_CHECK_OK    0xFF
typedef enum
{
    MMI_MODEM_PLMN_SEARCH_AUTO = 0,                                             // search automatically
    MMI_MODEM_PLMN_SEARCH_SPEC,                                                 // spec plmn search
    MMI_MODEM_PLMN_SEARCH_LIST                                                  // plmn list search
} MMI_MODEM_PLMN_SEARCH_TYPE;

typedef enum
{
    MMI_MODEM_PLMN_RAT_GSM = 0,                                                 // GSM network
    MMI_MODEM_PLMN_RAT_UMTS,                                                    // UTRAN network
    MMI_MODEM_PLMN_RAT_LTE,                                                     // LTE network
    MMI_MODEM_PLMN_RAT_UNKNOW
} MMI_MODEM_PLMN_RAT;

typedef enum
{
    MMI_MODEM_PLMN_UNKNOW = 0,
    MMI_MODEM_PLMN_AVAILABLE,                                                   // network is available
    MMI_MODEM_PLMN_CURRENT,                                                     // network is current
    MMI_MODEM_PLMN_FORBIDDEN                                                    // network is forbidden
} MMI_MODEM_PLMN_STAT;

typedef struct
{
#define MMI_MAX_PLMN_NAME_LEN    32 + 1
    char                PlmnName[MMI_MAX_PLMN_NAME_LEN];                        // plmn short name
    char                PlmnId[MMI_MAX_PLMN_NAME_LEN];                          // plmn ID
    MMI_MODEM_PLMN_RAT  PlmnRat;                                                // plmn RAT
    MMI_MODEM_PLMN_STAT PlmnStat;                                               // plmn status
} MMI_Modem_PLMN_Info;

typedef struct
{
    MMI_MODEM_SIM_ID           simId;
    MMI_MODEM_PLMN_SEARCH_TYPE SearchType;
    MMI_Modem_PLMN_Info        SpecPlmn;                                         // available only when SearchMode is SPEC
} MMI_Modem_Plmn_Search_Req_t;

typedef struct
{
    MMI_MODEM_SIM_ID    simId;
    uint8_t               PlmnCnt;                                                 // if plmn not fount when search type is list, set to 0
    // when search type is auto or spec, set to 0
    MMI_Modem_PLMN_Info *PlmnList;                                               // Variable size MMI_Modem_PLMN_Info*PlmnCnt
} MMI_Modem_Plmn_Search_Cnf_t;

typedef enum
{
    MMI_MODEM_SIGNAL_BAR_0,
    MMI_MODEM_SIGNAL_BAR_1,
    MMI_MODEM_SIGNAL_BAR_2,
    MMI_MODEM_SIGNAL_BAR_3,
    MMI_MODEM_SIGNAL_BAR_4,
    MMI_MODEM_SIGNAL_BAR_5
} MMI_MODEM_SIGNAL_BAR;

typedef struct
{
    uint8_t  tm_sec;                                                                // seconds [0,59]
    uint8_t  tm_min;                                                                // minutes [0,59]
    uint8_t  tm_hour;                                                               // hour [0,23]
    uint8_t  tm_mday;                                                               // day of month [1,31]
    uint8_t  tm_mon;                                                                // month of year [1,12]
    uint16_t tm_year;                                                               // years
    int8_t   timezone;
} MMI_Modem_Time_Info_t;

typedef struct
{
    uint16_t total;
    uint16_t used;
    uint16_t firstIndex;
} MMI_Modem_Phonebook_Status;

typedef struct
{
#define MMI_MODEM_MAX_NAME_LEN      19
    char   Name[MMI_MODEM_MAX_NAME_LEN];     // unused if deleting the contact with index from SIM phonebook
#define MMI_MODEM_MAX_NUMBER_LEN    21
    char   Number[MMI_MODEM_MAX_NUMBER_LEN]; // unused if deleting the contact with index from SIM phonebook
#define MMI_MODEM_CONTACT_INDEX_INVALID    0xFFFF
    uint16_t Index;                          // contact index in SIM phonebook, write new contact if MMI_MODEM_CONTACT_INDEX_INVALID
} MMI_Modem_Contact;

typedef enum
{
    MMI_MODEM_VOICE_NORMAL,
    MMI_MODEM_VOICE_EMERGENCY,
    MMI_MODEM_VOICE_SMS_ONLY,
} MMI_MODEM_VOICE_REG_STATE;

typedef enum
{
    MMI_MODEM_SMS_SUCCESS = 0,
    MMI_MODEM_SMS_MEM_FULL,
    MMI_MODEM_SMS_FAIL
} MMI_MODEM_SMS_RESULT_TYPE;

typedef enum
{
    MMI_MODEM_DELETE_ONE_BY_ONE = 0,
    MMI_MODEM_DELETE_ALL_READ,
    MMI_MODEM_DELETE_ALL
} MMI_MODEM_DELETE_SMS_TYPE;

typedef enum
{
    MMI_MODEM_UNREAD = 0,
    MMI_MODEM_READ,
    MMI_MODEM_UNSENT,
    MMI_MODEM_SENT
} MMI_MODEM_READ_SMS_TYPE;

typedef enum
{
    MMI_MODEM_SMS_RECEIVED = 0,
    MMI_MODEM_SMS_SENT,
    MMI_MODEM_SMS_ALL
} MMI_MODEM_SMS_OF_BOX;

typedef struct
{
    uint32_t                  MsgIndex;                                            // message index on SimX
    MMI_MODEM_READ_SMS_TYPE ReadSmsType;
    MMI_MODEM_SIM_ID        SimId;
} MMI_Modem_Msg_Content_Info_t;

typedef struct
{
    uint16_t           DeleteMsgCnt;                                               // when the eDelSmsType is MMI_MODEM_DELETE_ONE_BY_ONE,it will be avaliable.
    uint32_t           *pMsgIndex;                                                 // when the eDelSmsType is MMI_MODEM_DELETE_ONE_BY_ONE,it will be avaliable.Alloced size determined by usDeleteMsgCnt.
    MMI_MODEM_SIM_ID SimId;                                                      // when the eDelSmsType is MMI_MODEM_DELETE_ONE_BY_ONE,it will be avaliable.
} MMI_Modem_Delete_Sms_Req_t;

typedef struct
{
    MMI_MODEM_SMS_RESULT_TYPE    Result;
    MMI_MODEM_SMS_OF_BOX         SmsBox;
    uint16_t                       ReadMsgCnt;
    MMI_Modem_Msg_Content_Info_t *pMsgContentInfo;                               // Alloced size determined by usReadMsgCnt.
} MMI_Modem_Read_Sms_Info_Cnf_t;

typedef struct
{
    MMI_Modem_Msg_Content_Info_t MsgContentInfo;
} MMI_Modem_Report_New_Sms_Ind_t;

typedef struct
{
    uint32_t           MsgIndex;
    MMI_MODEM_SIM_ID SimId;
} MMI_Modem_Read_Sms_Detail_On_Sim_Req_t;

typedef struct
{
    MMI_MODEM_SMS_RESULT_TYPE Result;
    char                      *pSmsPdu;
    uint32_t                    MsgIndex;
    MMI_MODEM_SIM_ID          SimId;
} MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t;

typedef enum
{
    MMI_MODEM_WRITE_TO_SIM = 0,
    MMI_MODEM_NOT_WRITE_TO_SIM
} MMI_MODEM_WRITE_TO_SIM_FLG;

typedef struct
{
    char                       *pSmsc;
    char                       *pSmsPdu;
    MMI_MODEM_WRITE_TO_SIM_FLG WriteToSimFlg;
    MMI_MODEM_SIM_ID           SimId;
} MMI_Modem_Send_Sms_Req_t;

typedef struct
{
    MMI_MODEM_SMS_RESULT_TYPE Result;
#define MSG_INDEX_INVALID    0Xffffffff
    uint32_t                    MsgIndex;
    MMI_MODEM_SIM_ID          SimId;
} MMI_Modem_Send_Sms_Cnf_t;

typedef struct
{
    MMI_MODEM_SMS_RESULT_TYPE Result;
    char                      *pSmsc;
    MMI_MODEM_SIM_ID          SimId;
} MMI_Modem_Get_Smsc_Cnf_t;

typedef struct
{
    char             *pSmsc;
    MMI_MODEM_SIM_ID SimId;
} MMI_Modem_Set_Smsc_Req_t;

typedef enum
{
    MMI_MODEM_ENABLE = 0,
    MMI_MODEM_DISABLE
} MMI_MODEM_DELIVERY_REP_FLG;

typedef struct
{
    MMI_MODEM_DELIVERY_REP_FLG DeliveryRepFlg;
    MMI_MODEM_SIM_ID           SimId;
} MMI_Modem_Set_Delivery_Req_t;

typedef struct
{
    char             *pSmsStatusRep;
    MMI_MODEM_SIM_ID SimId;
} MMI_Modem_Response_Sms_Status_Rep_Ind_t;

typedef struct
{
    uint8_t             SimReady;              // true means SMS of sim is ready
    uint8_t             SimFull;               // true means SIM is full
    MMI_MODEM_SIM_ID SimId;
} MMI_Modem_SIM_SMS_Storage_Status_Ind_t;

typedef struct
{
    char             *pSendUssdReq;
    MMI_MODEM_SIM_ID SimId;
} MMI_Modem_Send_Ussd_Req_t;

typedef enum
{
    MMI_MODEM_CMD_SUCCESS = 0,
    MMI_MODEM_CMD_NOT_CNF,
    MMI_MODEM_UNKNOWN_CMD
} MMI_MODEM_USSD_RESULT_TYPE;

typedef struct
{
    MMI_MODEM_USSD_RESULT_TYPE Result;
    char                       *pSendUssdCnf;
    MMI_MODEM_SIM_ID           SimId;
} MMI_Modem_Send_Ussd_Cnf_t;

typedef struct {
    uint16_t   mcc;
    uint16_t   mnc;
    uint16_t   tac;
    uint16_t   euarfcn;
    uint32_t   cellid;
    uint32_t   rsrp;
    uint32_t   rsrq;
    uint16_t   uleuarfcn;
    uint32_t   band;
    uint32_t   dlbandwidth;
    uint32_t   sinr;
    uint32_t   errcmodestate;
    uint32_t   emmstate;
    uint32_t   servicestate;
    uint32_t   issingleemmrejectcause;
    uint32_t   emmrejectcause;
    uint32_t   mmegroupid;
    uint32_t   mmecode;
    uint32_t   mtmsi;
    uint32_t   scellpresent;
    uint32_t   phycellid;
    uint32_t   subframeassigntype;
    uint32_t   specialsubframepatterns;
    uint32_t   transmode;
    uint32_t   mainrsrp;
    uint32_t   diversityrsrp;
    uint32_t   mainrsrq;
    uint32_t   diversityrsrq;
    uint32_t   rssi;
    uint32_t   cqi;
    uint32_t   pathloss;
    uint32_t   tb0dltpt;
    uint32_t   tb1dltpt;
    uint32_t   tb0dlpeaktpt;
    uint32_t   tb1dlpeaktpt;
    uint32_t   tb0ulpeaktpt;
    uint32_t   tb1ulpeaktpt;
    uint32_t   dlthroughput;
    uint32_t   dlpeakthroughput;
    uint32_t   averdlprb;
    uint32_t   avercqitb0;
    uint32_t   avercqitb1;
    uint32_t   rankindex;
    uint32_t   granttotal;
    uint32_t   ulthroughput;
    uint32_t   ulpeakthroughput;
    uint32_t   currpuschtxpower;
    uint32_t   averulprb;
    uint32_t   dlbler;
    uint32_t   ulbler;
} MMI_MODEM_LTE_SCELL_INFO;

typedef struct {
    uint8_t  index;
    uint16_t euarfcn;
    uint32_t cellid;
    uint32_t rsrp;
    uint32_t rsrq;
} MMI_MODEM_LTE_NCELL_INFO;

typedef struct {
    uint16_t mcc;
    uint16_t mnc;
    uint16_t lac;
    uint16_t arfcn;
    uint8_t  bsic;
    uint32_t cell_id;
    uint8_t  rxlev;
} MMI_MODEM_GSM_CELL_INFO;

#define MMI_MODEM_MAX_LTE_NCELL_NUM   6
#define MMI_MODEM_MAX_GSM_NCELL_NUM   6

typedef struct
{
    MMI_MODEM_LTE_SCELL_INFO     scell;
    uint8_t                      encell_num;
    MMI_MODEM_LTE_NCELL_INFO     encell[MMI_MODEM_MAX_LTE_NCELL_NUM];
    uint8_t                      gncell_num;
    MMI_MODEM_GSM_CELL_INFO      gncell[MMI_MODEM_MAX_GSM_NCELL_NUM];
} MMI_Modem_Lte_Cells_t;

typedef struct
{
    MMI_MODEM_GSM_CELL_INFO      scell;
    uint8_t                      gncell_num;
    MMI_MODEM_GSM_CELL_INFO      gncell[MMI_MODEM_MAX_GSM_NCELL_NUM];
    uint8_t                      encell_num;
    MMI_MODEM_LTE_NCELL_INFO     encell[MMI_MODEM_MAX_LTE_NCELL_NUM];
} MMI_Modem_Gsm_Cells_t;

typedef struct
{
    uint8_t mode;
    uint8_t gsmBand;
    uint16_t lteBandH;
    uint32_t lteBandL;
} MMI_Modem_Set_Band_Req_t;

enum {
    MODEM_WAKE_UP_OTHERS = 0,
    MODEM_WAKE_UP_RING,
};
typedef UINT8 MODEM_WAKE_UP_REASON;

#define VIDEO_CALL_NAME_MAX_LEN 20
#define VIDEO_CALL_URI_MAX_LEN  30

enum {
    MODEM_VIDEO_CALL_TYPE_VOICE = 0,
    MODEM_VIDEO_CALL_TYPE_VIDEO
};
typedef UINT8 MODEM_VIDEO_CALL_TYPE;

typedef struct
{
    MODEM_VIDEO_CALL_TYPE calltype;
    char callname[VIDEO_CALL_NAME_MAX_LEN];
    char uri[VIDEO_CALL_URI_MAX_LEN];
} MMI_Modem_Video_Call_Response_Incoming_t;

enum {
    MODEM_VIDEO_CALL_REG_OK = 0,
    MODEM_VIDEO_CALL_REG_UNREGISTERING,
    MODEM_VIDEO_CALL_REG_FAIL
};
typedef UINT8 MODEM_VIDEO_CALL_REG_STAT;

enum
{
    MODEM_VIDEO_CALL_BARESIPAPI_HANGUP,
    MODEM_VIDEO_CALL_BARESIPAPI_REJ,
    MODEM_VIDEO_CALL_BARESIPAPI_ANSWER,
    MODEM_VIDEO_CALL_HANGUP_CONFLICT,
    MODEM_VIDEO_CALL_REJECT_CONFLICT
};
typedef UINT8 MODEM_VIDEO_CALL_ACTION;

enum {
    MODEM_VIDEO_CALL_BARESIPVIDMODE_OFF = 0,    /**< Video disabled                */
    MODEM_VIDEO_CALL_BARESIPVIDMODE_ON,         /**< Video enabled                 */
    MODEM_VIDEO_CALL_BARESIPVIDMODE_INV
};
typedef UINT8 MODEM_VIDEO_CALL_BARESIPVIDMODE;

#define MAX_APN_INFO_LEN 99

typedef void (*SwitchSimDoneCb)(UINT8);

typedef enum {
    CM_SIM_0,
    CM_SIM_1,
    NUM_OF_CM_SIM
}CMSimID;

typedef enum {
    APN_MODE_MANUAL = 0,
    APN_MODE_AUTO
}eApnMode;

enum {
    CM_IPTYPE_IPV4V6,
    CM_IPTYPE_IP,
    CM_IPTYPE_IPV6,
};

typedef struct {
    char apn[MAX_APN_INFO_LEN];
    /* 1-15 */
    UINT8 cid;
    UINT8 ipType;
    /**
    * isDefault 1: will modify LTE attach APN when call CM_SetPdpState to active the PDP context,
    * the cid value should only set to 1, specify other value will return error
    * 0: will create a new PDP context with cid
    */
    UINT8 isDefault;
} ApnInfo_s;

typedef struct
{
    uint8_t apnflg;                                         // apn & iptype valid flag: 0-invalid, 1-valid
    uint8_t iptype;                                         // 0-IPV4V6; 1-IPV4; 2-IPV6
    char    apn[NV_MAX_APN_INFO_LEN];                       // APN
} MMI_Modem_Apn_Info_t;

/**
 * power up SIMx request, used only when enable SIM.
 * modem should unset SIM disable status for next power up.
 * param (in) simId: MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Power_Up_Req(MMI_MODEM_SIM_ID simId);

/**
 * power up SIMx confrom
 * param (in) simId: MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Power_Up_Cnf(MMI_MODEM_SIM_ID simId);

/**
 * power off SIMx request, used when power off or SIM disable
 * modem should set the SIM disable status for next power up.
 * param (in) simId: MMI_MODEM_SIM_ID
 * param (in) PowerOffType: MMI_MODEM_POWER_OFF_TYPE
 * return  void
 */
extern void MMI_Modem_Power_Off_Req(MMI_MODEM_SIM_ID SimId, MMI_MODEM_POWER_OFF_TYPE PowerOffType);

/**
 * power off SIMx confrom
 * param (in) simId: MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Power_Off_Cnf(MMI_MODEM_SIM_ID simId);

/**
 * Requests current call list ( AT+CLCC)
 * param (out) calls:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Get_Current_Calls(MMI_MODEM_SIM_ID simId);

/**
 * Reponse current call list ( AT+CLCC)
 * param (out) calls:  MMI_Modem_Call_Rsp_Get_Current_Calls_t *
 * return  void
 */
extern void MMI_Modem_Call_Rsp_Get_Current_Calls(
    MMI_Modem_Call_Rsp_Get_Current_Calls_t *calls);

/**
 * Initiate voice call ( ATD<dial string>; or AT*DIALE=<dial string>,<service Type>)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) number:  phone number to dial
 * return  void
 */
extern void MMI_Modem_Call_Request_Dial(MMI_MODEM_SIM_ID simId, char *number,
                                        MMI_MODEM_CALL_SERVICE_TYPE ServiceType);

/**
 * Hang up a specific line (like AT+CHLD=1x)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) index:   Connection index (value of 'x' in CHLD above)
 * return  void
 */
extern void MMI_Modem_Call_Request_Hangup(MMI_MODEM_SIM_ID simId, int32_t index);

/**
 * Hang up waiting or held (like AT+CHLD=0)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Hangup_Waiting_Or_Background(MMI_MODEM_SIM_ID simId);

/**
 * Hang up active, and resume waiting or held (like AT+CHLD=1)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Hangup_Foreground_Resume_Background(MMI_MODEM_SIM_ID simId);

/*
 * Switch waiting or holding call and active call (like AT+CHLD=2)
 *
 * State transitions should be is follows:
 *
 * If call 1 is waiting and call 2 is active, then if this re
 *
 *   BEFORE                               AFTER
 * Call 1   Call 2                 Call 1       Call 2
 * ACTIVE   HOLDING                HOLDING     ACTIVE
 * ACTIVE   WAITING                HOLDING     ACTIVE
 * HOLDING  WAITING                HOLDING     ACTIVE
 * ACTIVE   IDLE                   HOLDING     IDLE
 * IDLE     IDLE                   IDLE        IDLE
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Switch_Waiting_Or_Holding_And_Active(MMI_MODEM_SIM_ID simId);

/**
 * Conference holding and active (like AT+CHLD=3)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Conference(MMI_MODEM_SIM_ID simId);

/**
 * Separate a party from a multiparty call placing the multiparty call
 * (less the specified party) on hold and leaving the specified party
 * as the only other member of the current (active) call
 *
 * Like AT+CHLD=2x
 *
 * See TS 22.084 1.3.8.2 (iii)
 * TS 22.030 6.5.5 "Entering "2X followed by send"
 * TS 27.007 "AT+CHLD=2x"
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) index:   Connection index (value of 'x' in CHLD above)
 * return  void
 */
extern void MMI_Modem_Call_Request_Separate_Connection(MMI_MODEM_SIM_ID simId, int32_t index);

/**
 * Connects the two calls and disconnects the subscriber from both calls (ECT). (AT+CHLD=4)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Explicit_Call_Transfer(MMI_MODEM_SIM_ID simId);

/**
 * Send UDUB (user determined user busy) to ringing or
 * waiting call answer  (AT+CHLD=0)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Udub(MMI_MODEM_SIM_ID simId);

/**
 * Answer incoming call (ATA)
 *
 * Will not be called for WAITING calls.
 * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case instead
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Answer(MMI_MODEM_SIM_ID simId);

/**
 * Send a DTMF tone (AT+VTS=<DTMF>)
 *
 * If the implementation is currently playing a tone requested via
 * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
 * should be played instead
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) dtmf:  MMI_MODEM_CALL_REQUEST_DTMF *
 * return  void
 */
extern void MMI_Modem_Call_Request_Dtmf(MMI_MODEM_SIM_ID simId,
                                        MMI_Modem_Call_Request_Dtmf_t                        *dtmf);

/**
 * Start playing a DTMF tone. Continue playing DTMF tone until
 * RIL_REQUEST_DTMF_STOP is received (AT+VTS=<DTMF>)
 *
 * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
 * it should cancel the previous tone and play the new one.
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) dtmf: a single character with one of 12 values: 0-9,*,#
 * return  void
 */
extern void MMI_Modem_Call_Request_Dtmf_Start(MMI_MODEM_SIM_ID simId, char dtmf);

/**
 * Stop playing a currently playing DTMF tone. (AT)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Dtmf_stop(MMI_MODEM_SIM_ID simId);

/**
 * Turn on or off uplink (microphone) mute. ("AT+CMUT=<n>)
 *
 * Will only be sent while voice call is active.
 * Will always be reset to "disable mute" when a new voice call is initiated
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) mute:   TRUE for "enable mute" and FALSE for "disable mute"
 * return  void
 */
extern void MMI_Modem_Call_Request_Set_Mute(MMI_MODEM_SIM_ID simId, uint8_t mute);

/**
 * Queries the current state of the uplink mute setting (AT+CMUT?)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (out) mute:   1 for "mute enabled" and 0 for "mute disabled"
 * return  void
 */
extern void MMI_Modem_Call_Request_Get_Mute(MMI_MODEM_SIM_ID simId, int32_t *mute);

/**
 * Gets IMEI (#*06#)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Imei(MMI_MODEM_SIM_ID simId);

/**
 * Get baseband version for modemadp
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Request_Baseband_Version(MMI_MODEM_SIM_ID simId);

/**
 * Get baseband version for ui
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Call_Query_Baseband_Version(MMI_MODEM_SIM_ID simId ,char* baseband_ver);

/**
 * Query Imsi
 * param (in) SimId: MMI_MODEM_SIM_ID
         (out) Operator: INT8 *
 * return  void
 */
extern VOID MMI_Modem_Query_Imei_Req(MMI_MODEM_SIM_ID SimId, INT8 * Imei);

/**
 *
 * This message is sent to the calling mobile station
 *  to indicate that the call is originating. (after ATD <number>;)
 * param simId:  MMI_MODEM_SIM_ID
 * param index:  Connection index
 * return  void
 */
extern void MMI_Modem_Call_Response_Originating(MMI_MODEM_SIM_ID simId, int32_t index);

/**
 *
 * This message is sent to the calling mobile station
 *  to indicate that the called user alerting has been initiated.
 * param simId:  MMI_MODEM_SIM_ID
 * param index:  Connection index
 * return  void
 */
extern void MMI_Modem_Call_Response_Alerting(MMI_MODEM_SIM_ID simId, int32_t index);

/**
 *
 * This message is sent to the called mobile station
 *  to indicate an incoming call (voice, data or fax). (RING)
 * param simId:  MMI_MODEM_SIM_ID
 * param index:  Connection index
 * return  void
 */
extern void MMI_Modem_Call_Response_Ring(MMI_MODEM_SIM_ID simId, int32_t index);

/**
 * This message is sent to the calling/called mobile station
 *  to indication that the call is connected.
 * param simId:  MMI_MODEM_SIM_ID
 * param index:  Connection index
 * return  void
 */
extern void MMI_Modem_Call_Response_Connect(MMI_MODEM_SIM_ID simId, int32_t index);

/**
 * This message is sent to the calling/called mobile station
 *  to indication that the call is disconnected.
 * param simId:  MMI_MODEM_SIM_ID
 * param index:  Connection index
 * return  void
 */
extern void MMI_Modem_Call_Response_Disconnect(MMI_MODEM_SIM_ID simId, int32_t index);

/**
 * Indicates a disconnect for Call Clearing or a Call Failed for an outgoing call. (NO CARRIER)
 * param simId:  MMI_MODEM_SIM_ID
 * param index:  Connection index
 * param isNoCarrier:  uint8_t
 * return  void
 */
extern void MMI_Modem_Call_Response_No_Carrier(MMI_MODEM_SIM_ID simId, int32_t index, uint8_t isNoCarrier);

/**
 * Indicates ATD OK or cme error for an outgoing call.
 * param simId:  MMI_MODEM_SIM_ID
 * param isOk:  uint8_t,0 is OK,1 is cme error
 * return  void
 */
extern void MMI_Modem_Call_Response_Dial(MMI_MODEM_SIM_ID simId, uint8_t isOk);

/**
 * Indicates the calling line identity of the calling party after every RING/+CRING. (+CLIP:)
 * +CLIP: <number>,<type>
 *
 * param simId:  MMI_MODEM_SIM_ID
 * param index:  Connection index
 * param clip:  MMI_MODEM_CALL_RESPONSE_CLIP *
 * return  void
 */
extern void MMI_Modem_Call_Response_Clip(MMI_MODEM_SIM_ID simId, int32_t index,
        MMI_Modem_Call_Response_Clip_t *clip);

/**
 * Indicates Call Waiting (CW) information (when enabled) for an incoming call. (+CCWA:)
 * +CCWA: <number>,<type>,<class>,[<alpha>][,<CLI validity>[,<subaddr>,<satype>[,<priority>]]]
 *
 * param simId:  MMI_MODEM_SIM_ID
 * param index:  Connection index
 * param ccwa:  MMI_MODEM_CALL_RESPONSE_CCWA *
 * return  void
 */
extern void MMI_Modem_Call_Response_Ccwa(MMI_MODEM_SIM_ID simId, int32_t index,
        MMI_Modem_Call_Response_Ccwa_t *ccwa);

/**
 * Indicats the call state is changed
 *
 * param state:  MMI_MODEM_CALL_RESPONSE_STATE_CHANGE *
 * return  void
 */
extern void MMI_Modem_Call_Response_State_Change(MMI_Modem_Call_Response_State_Change_t *state);

/**
 * Indicates whether remote state is hold
 *
 * param simId:  MMI_MODEM_SIM_ID
 * param index:  Connection index
 * param IsHold: uint8_t ture for hold, and false for unhold
 * return  void
 */
extern void MMI_Modem_Call_Response_Remote_Hold(MMI_MODEM_SIM_ID SimId, int32_t Index, uint8_t IsHold);

/**
 * Indicates the Mute control after every +CMUT?. (+CMUT:)
 * +CMUT: <n>
 * +CME ERROR: <err>
 *
 * param simId: MMI_MODEM_SIM_ID
 * param cmut:  MMI_MODEM_CALL_RESPONSE_CMUT *
 * return  void
 */
extern void MMI_Modem_Call_Response_Cmut(MMI_MODEM_SIM_ID simId, MMI_Modem_Call_Response_Cmut_t * cmut);

/**
 * Indicates call fail cause.
 * param simId:  MMI_MODEM_SIM_ID
 * param ceer:  call fail cause
 * return  void
 */
extern void MMI_Modem_Call_Response_Ceer(MMI_MODEM_SIM_ID simId, char *ceer);

/**
 * enable PIN lock
 * param (in) PinLockSet:  MMI_Modem_Pin_Lock_t*
 *       (in) PIN: char*, PIN code
 * return  void
 */
extern void  MMI_Modem_Enable_Pin_Lock(MMI_Modem_Pin_Lock_t *PinLockSet, char *PIN);

/**
 * query facility PIN lock info
 * param (in) PinLockSet:  MMI_Modem_Pin_Lock_t*
 * return  void
 */
extern VOID  MMI_Modem_Query_Facility_Pin_Lock(MMI_Modem_Pin_Lock_t * PinLockSet);

/**
 * enable PIN lock
 * param (in/out) PinLockQuery: MMI_Modem_Pin_Lock_t*
 * return  void
 */
extern void  MMI_Modem_Query_Pin_Lock(MMI_Modem_Pin_Lock_t *PinLockQuery);

/**
 * indicate that PIN status changed
 * param (in) simId      :  MMI_MODEM_SIM_ID
 *       (in) PinReqType :  MMI_MODEM_PIN_STATUS_TYPE
 * return  void
 */
extern void  MMI_Modem_Pin_Status_Change_Ind(MMI_MODEM_SIM_ID SimId,
        MMI_MODEM_PIN_STATUS_TYPE                                 PinReqType);

/**
 * Request modem adpter to try PIN code
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) PIN:  char*
 * return  uint8_t: Retry Left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
extern uint8_t MMI_Modem_Try_Pin_Req(MMI_MODEM_SIM_ID SimId, char *PIN);

/**
 * Request modem adpter to try PIN2 code
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) PIN2:  char*
 * return uint8_t: retry left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
extern uint8_t MMI_Modem_Try_Pin2_Req(MMI_MODEM_SIM_ID SimId, char *PIN2);

/**
 * Request modem adpter to try PUK code
 * param (in) simId:  MMI_MODEM_SIM_ID
 *       (in) PUK:  char*
 *       (in) NewPIN: char*
 * return  uint8_t: Retry Left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
extern uint8_t MMI_Modem_Try_Puk_Req(MMI_MODEM_SIM_ID SimId, char *PUK, char *NewPIN);

/**
 * Request modem adpter to try PUK2 code
 * param (in) simId:  MMI_MODEM_SIM_ID
 *       (in) PUK2:  char*
 *       (in) NewPIN2: char*
 * return uint8_t: retry left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
extern uint8_t MMI_Modem_Try_Puk2_Req(MMI_MODEM_SIM_ID SimId, char *PUK2, char *NewPIN2);

/**
 * Request modem adpter to change PIN code
 * param (in) simId:  MMI_MODEM_SIM_ID
 *       (in) PIN:    char*
 *       (in) OldPIN: char*
 * return  uint8_t: Retry Left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
extern uint8_t MMI_Modem_Change_Pin_Req(MMI_MODEM_SIM_ID SimId, char *PIN, char *OldPIN);

/**
 * Request modem adpter to change PIN2 code
 * param (in) simId:  MMI_MODEM_SIM_ID
 *       (in) PIN2:    char*
 *       (in) OldPIN2: char*
 * return  uint8_t: Retry Left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
extern uint8_t MMI_Modem_Change_Pin2_Req(MMI_MODEM_SIM_ID SimId, char *PIN2, char *OldPIN2);

/**
 * Request modem adpter to search plmn
 * param (in) PlmnSearchReq: MMI_Modem_Plmn_Search_Req_t
 * return void
 */
extern void MMI_Modem_Plmn_Search_Req(MMI_Modem_Plmn_Search_Req_t *PlmnSearchReq);

/**
 * plmn search confirm
 * param (in) PlmnSearchCnf:  MMI_Modem_Plmn_Search_Cnf_t
 * return void:
 */
extern void MMI_Modem_Plmn_Search_Cnf(MMI_Modem_Plmn_Search_Cnf_t *PlmnSearchCnf);

/**
 * plmn search confirm
 * param void:
 * return void:
 */
extern void MMI_Modem_Plmn_Search_Stop_Req(void);

/**
 * configure SS service call wait
 * param (in) SimId : MMI_MODEM_SIM_ID
 * param (in) CallForwardInfo : MMI_Modem_Call_Forward_Info_t
 * return void:
 */
extern void MMI_Modem_Call_Forward_Set_Req(MMI_MODEM_SIM_ID SimId,
        MMI_Modem_Call_Forward_Info_t                           *CallForwardInfo);

/**
 * configure SS service call wait confirm
 * param (in) SimId  : MMI_MODEM_SIM_ID
 *       (in) Result : MMI_MODEM_RESULT
 * return void:
 */
extern void MMI_Modem_Call_Forward_Set_Cnf(MMI_MODEM_SIM_ID SimId, MMI_MODEM_RESULT Result);

/**
 * get SS service call wait confirm
 * param (in) SimId  : MMI_MODEM_SIM_ID
 *       (in) CallForwardType : MMI_MODEM_CALL_FORWARD_TYPE
 * return MMI_Modem_Call_Forward_Info_t *
 */
extern MMI_Modem_Call_Forward_Info_t * MMI_Modem_Call_Forward_Get_Req(MMI_MODEM_SIM_ID SimId,MMI_MODEM_CALL_FORWARD_TYPE CallForwardType);

/**
 * query SS service call wait
 * param (in) SimId           : MMI_MODEM_SIM_ID
 * param (in) CallForwardType : MMI_MODEM_CALL_FORWARD_TYPE(query type)
 * return void
 */
extern void MMI_Modem_Call_Forward_Query_Req(MMI_MODEM_SIM_ID SimId,
        MMI_MODEM_CALL_FORWARD_TYPE                               CallForwardType);

/**
 * query SS service call wait confirm
 * param (in) SimId  : MMI_MODEM_SIM_ID
 * param (in) Result : MMI_MODEM_RESULT
 * param (in) CallForwardInfo : MMI_Modem_Call_Forward_Info_t(response of check status)
 * return void
 */
extern void MMI_Modem_Call_Forward_Query_Cnf(MMI_MODEM_SIM_ID SimId, MMI_MODEM_RESULT Result,
        MMI_Modem_Call_Forward_Info_t *CallForwardInfo);

/**
 * configure SS service call wait
 * param (in) SimId : MMI_MODEM_SIM_ID
 * param (in) CallWaitOn : uint8_t (true means call wait on)
 * return void:
 */
extern void MMI_Modem_Call_Wait_Set_Req(MMI_MODEM_SIM_ID SimId, BOOL CallWaitOn);

/**
 * configure SS service call wait confirm
 * param (in) SimId : MMI_MODEM_SIM_ID
 * param (in) Result : MMI_MODEM_RESULT
 * return void:
 */
extern void MMI_Modem_Call_Wait_Set_Cnf(MMI_MODEM_SIM_ID SimId, MMI_MODEM_RESULT Result);

/**
 * get SS service call wait
 * param (in) SimId : MMI_MODEM_SIM_ID
 * return uint8_t
 */
extern uint8_t MMI_Modem_Call_Wait_Get_Req(MMI_MODEM_SIM_ID SimId);

/**
 * query SS service call wait
 * param (in) SimId : MMI_MODEM_SIM_ID
 * return void
 */
extern void MMI_Modem_Call_Wait_Query_Req(MMI_MODEM_SIM_ID SimId);

/**
 * query SS service call wait confirm
 * param (in) SimId : MMI_MODEM_SIM_ID
 * param (in) CallWaitOn : uint8_t
 * return void
 */
extern void MMI_Modem_Call_Wait_Query_Cnf(MMI_MODEM_SIM_ID SimId, uint8_t CallWaitOn, MMI_MODEM_RESULT Result);

/**
 * Signal bar indication
 * param (in) Bar:  MMI_MODEM_SIGNAL_BAR
 * return  void
 */
extern void MMI_Modem_Signal_Bar_Ind(MMI_MODEM_SIM_ID SimId, MMI_MODEM_SIGNAL_BAR Bar);

/**
 * Signal bar indication
 * param (in) Bar:  MMI_MODEM_SIGNAL_BAR
 * return  void
 */
extern MMI_MODEM_SIGNAL_BAR MMI_Modem_Get_Signal_Bar_Req(MMI_MODEM_SIM_ID SimId);

/**
 * set volte state
 * param (in) state: UINT8
 * return  void
 */
extern void MMI_ModemAdp_Set_Volte_State_Req(MMI_MODEM_SIM_ID SimId, UINT8 State);

/**
 * Operator(short name) indicator reported when register at the first time
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) Operator: char*
 * return  void
 */
extern void MMI_Modem_Operator_Ind(MMI_MODEM_SIM_ID SimId, char *Operator, MMI_MODEM_PLMN_RAT Rat);

/**
 * get Operator(short name)
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) Operator: char*
 * return  void
 */
extern void MMI_Modem_Get_Operator_Req(MMI_MODEM_SIM_ID SimId, char *Operator, MMI_MODEM_PLMN_RAT *Rat);

/*
 * Request IMS register state
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  UINT8
 */
extern UINT8 MMI_Modem_Get_Ims_Reg_State_Req(MMI_MODEM_SIM_ID SimId);

/*
 * Request GSM register state
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  UINT8
 */
extern UINT8 MMI_Modem_Get_Gsm_Reg_State_Req(MMI_MODEM_SIM_ID SimId);

/*
 * Request UMTS register state
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  UINT8
 */
extern UINT8 MMI_Modem_Get_Umts_Reg_State_Req(MMI_MODEM_SIM_ID SimId);

/**
 * Control WIFI search request
 * param (in) Option:
 *     0 - stop to wifi hotspot search,
 *     1 - start to wifi hotspot search
 * param (in) ScanRounds: range 1-3, rounds of wifi scan
 * param (in) MaxHotspotNumber: range 4-10, maximum number of wifi hotspots reported
 * param (in) TimeoutSeconds: range 1-25, timeout value to scan wifi in seconds
 * param (in) Priority: 0, data traffic has higher priority than wifi scan,
 *                         data traffic will interrupt the wifi scan;
 *                      1, data traffic has lower priority than wifi scan,
 *                         data traffic will be blocked during wifi scan
 * return  UINT8
 */
extern UINT8 MMI_Modem_Wifi_Ctrl_Req(UINT8 Option,
                                     UINT8 ScanRounds,
                                     UINT8 MaxHotspotNum,
                                     UINT32 TimeoutSeconds,
                                     UINT8 Priority);

/**
 * Set WIFI scan parameters
 * param (in) TimeoutSeconds: UINT32
 * param (in) Cb: app_adp_wifi_scan_cb
 * return  void
*/
extern void MMI_Modem_Set_Wifi_Scan_Para(UINT32 TimeoutSeconds, app_adp_wifi_scan_cb Cb);

/**
 * time auto-update indication
 * param (in) :
 * return  void
 */
extern void MMI_Modem_Time_Update_Ind(MMI_Modem_Time_Info_t *TimeInfo);

/**
 * SIM status indicator
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) SimPresent: uint8_t
 * return  void
 */
extern void MMI_Modem_Sim_Status_Ind(MMI_Modem_Sim_Status_t *SimStatus);

/**
 * check whether sim is present.
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  uint8_t: ture means sim present
 */
extern uint8_t MMI_Modem_Sim_Present_Check_Req(MMI_MODEM_SIM_ID simId);

/**
 * Request CP phone book status
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Get_Phonebook_Status_Req(MMI_MODEM_SIM_ID SimId);

/**
 * Response for getting phone book status
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) PhkStatus: MMI_Modem_Phonebook_Status*
 * return  void
 */
extern void MMI_Modem_Get_Phonebook_Status_Cnf(MMI_MODEM_SIM_ID SimId,
        MMI_Modem_Phonebook_Status                                  *PhkStatus);

/**
 * Request to write new contact into phone book
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) Contact: MMI_Modem_Contact*, delete if name is invalid, write to the first free location if index is invalid
 * return  void
 */
extern void MMI_Modem_Write_Phonebook_Req(MMI_MODEM_SIM_ID SimId, MMI_Modem_Contact *Contact);

/**
 * Response for updating contact into phone book
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) WrittenIndex: uint16_t
 * return  void
 */
extern void MMI_Modem_Write_Phonebook_Cnf(MMI_MODEM_SIM_ID SimId, uint16_t WrittenIndex);

/**
 * Request to read all of contacts from phone book
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) FirstIndex: UINT16
 * return  void
 */
extern void MMI_Modem_Read_Phonebook_Req(MMI_MODEM_SIM_ID SimId, UINT16 Used, UINT16 FirstIndex);

/**
 * Request to get IMSI
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern VOID MMI_Modem_Get_Imsi_Req(MMI_MODEM_SIM_ID SimId);

/**
 * Query Imsi
 * param (in) SimId: MMI_MODEM_SIM_ID
         (out) Operator: INT8 *
 * return  void
 */
extern VOID MMI_Modem_Query_Imsi_Req(MMI_MODEM_SIM_ID SimId, INT8 * Imsi);

/**
 * Request to get ICCID
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern VOID MMI_Modem_Get_Iccid_Req(MMI_MODEM_SIM_ID SimId);

/**
 * Request to get MSISDN
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern VOID MMI_Modem_Get_Msisdn_Req(MMI_MODEM_SIM_ID SimId);

/**
 * Request to get PLMN
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern VOID MMI_Modem_Get_Plmn_Req(MMI_MODEM_SIM_ID SimId);

/**
 * Request to select TE character set(AT+CSCS="HEX")
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern VOID MMI_Modem_Select_Character_Set_Req(MMI_MODEM_SIM_ID simId);

/**
 * Request to do sim soft reset
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern VOID MMI_Modem_Sim_Soft_Reset_Req(MMI_MODEM_SIM_ID SimId);

/**
 * Response for reading contacts from phone book
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) Contact: MMI_Modem_Contact*
 * param (in) Number: uint16_t
 * param (in) End: BOOL
 * return  void
 */
extern void MMI_Modem_Read_Phonebook_Cnf(MMI_MODEM_SIM_ID SimId,
                                         MMI_Modem_Contact *Contact,
                                         uint16_t Number,
                                         BOOL End);

/**
 * Indicate When phone book has been loaded by CP
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Phonebook_Init_Ind(MMI_MODEM_SIM_ID SimId);

/*
 * Request current voice registration state
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  uint8_t: MMI_MODEM_VOICE_REG_STATE
 */
extern uint8_t MMI_Modem_Voice_Registration_State_Req(MMI_MODEM_SIM_ID SimId);

/**
 * send new sms req
 * param (in) pSendSms: MMI_Modem_Send_Sms_Req_t
 * return  void
 */
extern void MMI_Modem_Send_Sms_Req(MMI_Modem_Send_Sms_Req_t *pSendSms);

/**
 * send new sms cnf
 * param (in) pSendSmsCnf: MMI_Modem_Send_Sms_Cnf_t
 * return  void
 */
extern void MMI_Modem_Send_Sms_Cnf(MMI_Modem_Send_Sms_Cnf_t *pSendSmsCnf);

/**
 * delete sms req
 * param (in) pDeleteSms: MMI_Modem_Delete_Sms_Req_t
 * return  void
 */
extern void MMI_Modem_Delete_Sms_Req(MMI_Modem_Delete_Sms_Req_t *pDeleteSms);

/**
 * delete sms cnf
 * param (in) Result:MMI_MODEM_SMS_RESULT_TYPE
 * return  void
 */
extern void MMI_Modem_Delete_Sms_Cnf(MMI_MODEM_SMS_RESULT_TYPE Result);

/**
 * read sms info req
 * param (in) SmsBox: MMI_MODEM_SMS_OF_BOX
 * return  void
 */
extern void MMI_Modem_Read_Sms_Info_Req(MMI_MODEM_SMS_OF_BOX SmsBox);

/**
 * read sms info cnf
 * param (in) pReadSmsInfoCnf: MMI_Modem_Read_Sms_Info_Cnf_t
 * return  void
 */
extern void MMI_Modem_Read_Sms_Info_Cnf(MMI_Modem_Read_Sms_Info_Cnf_t *pReadSmsInfoCnf);

/**
 * read sms detail on sim req
 * param (in) pReadSmsReq: MMI_Modem_Read_Sms_Detail_On_Sim_Req_t
 * return  void
 */
extern void MMI_Modem_Read_Sms_Detail_On_Sim_Req(
    MMI_Modem_Read_Sms_Detail_On_Sim_Req_t *pReadSmsReq);

/**
 * read sms detail on sim cnf
 * param (in) pReadSmsCnf: MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t
 * return  void
 */
extern void MMI_Modem_Read_Sms_Detail_On_Sim_Cnf(
    MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t *pReadSmsCnf);

/**
 * get sms centre number req
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Get_Smsc_Req(MMI_MODEM_SIM_ID SimId);

/**
 * get sms centre number cnf
 * param (in) pGetSmscCnf: MMI_Modem_Get_Smsc_Cnf_t
 * return  void
 */
extern void MMI_Modem_Get_Smsc_Cnf(MMI_Modem_Get_Smsc_Cnf_t *pGetSmscCnf);

/**
 * set sms centre number req
 * param (in) pSetSmscReq: MMI_Modem_Set_Smsc_Req_t
 * return  void
 */
extern void MMI_Modem_Set_Smsc_Req(MMI_Modem_Set_Smsc_Req_t *pSetSmscReq);

/**
 * set sms centre number cnf
 * param (in) Result:MMI_MODEM_SMS_RESULT_TYPE
 * return  void
 */
extern void MMI_Modem_Set_Smsc_Cnf(MMI_MODEM_SMS_RESULT_TYPE Result);

/**
 * set delivery report flg req
 * param (in) pSetDeliveryRep: MMI_Modem_Set_Delivery_Req_t
 * return  void
 */
extern void MMI_Modem_Set_Delivery_Rep_Req(MMI_Modem_Set_Delivery_Req_t *pSetDeliveryRep);

/**
 * set delivery report flg cnf
 * param (in) Result:MMI_MODEM_SMS_RESULT_TYPE
 * return  void
 */
extern void MMI_Modem_Set_Delivery_Rep_Cnf(MMI_MODEM_SMS_RESULT_TYPE Result);

/**
 * report new sms ind
 * param (in) pRepNewSms:MMI_Modem_Report_New_Sms_Ind_t
 * return  void
 */
extern void MMI_Modem_Rep_New_Sms_Ind(MMI_Modem_Report_New_Sms_Ind_t *pRepNewSms);

/**
 * report new status report ind
 * param (in) pRepNewStsRep:MMI_Modem_Response_Sms_Status_Rep_Ind_t
 * return  void
 */
extern void MMI_Modem_Sms_Status_Rep_Ind(MMI_Modem_Response_Sms_Status_Rep_Ind_t *pSmsStsRep);

/**
 * report SMS storage status of SIM
 * param (in) pRepSimSmsStaInd: MMI_Modem_SIM_SMS_Storage_Status_Ind
 * return  void
 */
extern void MMI_Modem_SIM_SMS_Storage_Status_Ind(
    MMI_Modem_SIM_SMS_Storage_Status_Ind_t *pRepSimSmsStaInd);

/**
 * send ussd req
 * param (in) pSendUssdReq: MMI_Modem_Send_Ussd_Req_t
 * return  void
 */
extern void MMI_Modem_Send_Ussd_Req(MMI_Modem_Send_Ussd_Req_t *pSendUssdReq);

/**
 * send Ussd cnf
 * param (in) pSendUssdCnf: MMI_Modem_Send_Ussd_Cnf_t
 * return  void
 */
extern void MMI_Modem_Send_Ussd_Cnf(MMI_Modem_Send_Ussd_Cnf_t *pSendUssdCnf);

/**
 * ussd cancel
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
extern void MMI_Modem_Ussd_Cancel_Req(MMI_MODEM_SIM_ID SimId);

/**
 * initiate mmi-modem adaptor module
 * param (in) FlightModeOn: UINT8
 * return  void
 */
VOID MMI_ModemAdp_Init_Req(UINT8 FlightModeOn);

/*
 * indicate screen state to modem
 * Notify CP that AP will wake or sleep
 * param   state, true meas lcd on
 * return  void
 */
extern void MMI_ModemAdp_Screen_State_Req(int state);

/**
 * Queries the current call active status
 * param void
 * return  bool
 */
extern BOOL MMI_ModemAdp_Call_Get_Call_Active_Status(VOID);

/**
 * Set GSM and LTE band information for engineer mode
 * param (in) pSetBandReq: MMI_Modem_Set_Band_Req_t
 * return  void
 */
extern void MMI_Modem_Set_Band_Req(MMI_Modem_Set_Band_Req_t *pSetBandReq);

/**
 * get cell information request in engineer mode
 * param (in) void:
 * return  void
*/
extern void MMI_ModemAdp_Get_Cell_Info_Req(void);

/**
 * report the lte cells information in engineer mode
 * param (in) MMI_Modem_Lte_Cells_t  *ltecells
 * return  void
 */
extern void MMI_Modem_Lte_Cells_Ind(MMI_Modem_Lte_Cells_t  *ltecells);

/**
 * report the gsm cells information in engineer mode
 * param (in) MMI_Modem_Lte_Cells_t  *ltecells
 * return  void
 */
extern void MMI_Modem_Gsm_Cells_Ind(MMI_Modem_Gsm_Cells_t  *gsmcells);

extern UINT8 MMI_ModemAdp_Get_Ril_Ready_state(VOID);

/*
 * Request Volte om/off state
 * param (in) SimId: MMI_MODEM_SIM_ID;state: UINT8
 * return  VOID
 */
extern VOID MMI_Modem_Volte_State_Req(MMI_MODEM_SIM_ID SimId, UINT8 state);

/*
 * Request Volte state
 * param (in) SimId: VOID
 * return  UINT8
 */
extern UINT8 MMI_Modem_Get_Volte_State_Req(MMI_MODEM_SIM_ID SimId);

/*
 * set Neighbour Bch query option
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) option: 0/1
 * return  VOID
 */
extern VOID MMI_Modem_Set_Ncell_Bch_Req(MMI_MODEM_SIM_ID SimId, UINT8 option);

/*
 * Request radio power status
 * param (in) SimId: VOID
 * param (in) Cb: app_adp_radio_power_cb *
 * return  VOID
 */
extern VOID MMI_Modem_Radio_Power_Status_Req(MMI_MODEM_SIM_ID simId, app_adp_radio_power_cb Cb);

/**
 * report the nw ims vops status
 * param (in) MMI_MODEM_SIM_ID simId
 * param (in) uint8_t display_sendsms_flg //0:display not send sms,1:display send sms
 * return  void
 */
void MMI_Modem_Ims_Vops_Ind(MMI_MODEM_SIM_ID simId,uint8_t display_sendsms_flg);

/**
 * get roaming status
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  INT8: 0 not raoming, 1 roaming
 */
UINT8 MMI_Modem_Get_Roaming_Stat_Req(MMI_MODEM_SIM_ID SimId);

/**
 * get calibration information request in engineer mode
 * param (in) void:
 * return  void
*/
extern void MMI_ModemAdp_Get_Calibration_Info_Req(MMI_MODEM_SIM_ID SimId);

/**
 * get SN information request in engineer mode
 * param (in) void:
 * return  void
*/
extern void MMI_ModemAdp_Get_Sn_Info_Req(MMI_MODEM_SIM_ID SimId);

/**
 * report the calibration result in engineer mode
 * param (in) ucResult: UINT8
 * return  void
 */
extern void MMI_Modem_Cali_Rslt_Ind(UINT8 ucResult);

/**
 * report the SN information in engineer mode
 * param (in) pSn: INT8*
 * return  void
 */
extern void MMI_Modem_Sn_Info_Ind(INT8 *pSn);

/**
 *
 * This message is sent to the called mobile station
 * to indicate an incoming video call
 * param para:  MMI_Modem_Video_Call_Response_Incoming_t *
 * return  void
 */
void MMI_Modem_Video_Call_Response_Incoming(MMI_Modem_Video_Call_Response_Incoming_t *Response);

/**
 *
 * This message is sent to the UI for common response
 * param simId:  MMI_MODEM_SIM_ID
 * return  void
 */
void MMI_Modem_Video_Call_Common_Response(uint16_t MsgId);

/**
 *
 * This message is sent to the UI for voice mo test
 * param simId:  MMI_MODEM_SIM_ID
 * return  void
 */
void MMI_Modem_Video_Call_Response_Test_Voice_Mo_Req(char * uri);

    /**
 *
 * This message is sent to the UI for voice mo test
 * param simId:  MMI_MODEM_SIM_ID
 * return  void
 */
void MMI_Modem_Video_Call_Response_Test_Video_Mo_Req(char * uri);

/**
 * This is used to set local preview
 * param stat:
 * return  void
 */
VOID MMI_Modem_Video_Call_Set_Local_Preview_Req(BOOL localpreview);

/**
 * This is used to control video call action
 * param op: UINT16
 * param vidType: UINT16
 * return  UINT32
 */
UINT32 MMI_Modem_Video_Call_Action_Req(MODEM_VIDEO_CALL_ACTION op,
                                       MODEM_VIDEO_CALL_BARESIPVIDMODE vidType);

/**
 * This is used to start  video call
 * param calltype: MODEM_VIDEO_CALL_TYPE
 * param pContactUri: char*
 * return  UINT32
 */
INT32 MMI_Modem_Video_Call_Dial_Req(MODEM_VIDEO_CALL_TYPE calltype, char * pContactUri);

/**
 * This is used to get the reg state of video call.
 * param stat:  reg status
 * return  void
 */
UINT8 MMI_Modem_Video_Call_Get_Reg_Stat_Req(void);

/**
 * This is used to set connection switch
 * param (in) OnOff: BOOL
 * return  void
 */
void MMI_ModemAdp_Set_Connection_Switch(BOOL OnOff);

/**
 * This is used to get connection switch
 * param (in) void
 * return  BOOL
 */
BOOL MMI_ModemAdp_Get_Connection_Switch(void);

/**
 * This is used to set data roaming
 * param (in) OnOff: BOOL
 * return  void
 */
void MMI_ModemAdp_Set_Data_Roaming(BOOL OnOff);

/**
 * This is used to get data roaming
 * param (in) void
 * return  BOOL
 */
BOOL MMI_ModemAdp_Get_Data_Roaming(void);

/**
 * This is used to get default connection APN name
 * param (in) Name: buffer to get apn name string
 * param (in) NameLen: buffer len of name
 * return 0: get default name successfully;  -1: get default name failed
 */
int MMI_ModemAdp_Get_Default_Apn_Name(char *Name, int NameLen);

/**
 * This is used to get default IP type
 * param (in) void
 * return 0-IPV4V6; 1-IPV4; 2-IPV6
 */
int MMI_ModemAdp_Get_Default_Ip_Type(void);

/**
 * This is used to set apn info
 * param (in) ApnInfo: MMI_Modem_Apn_Info_t *
 * return void
 */
void MMI_ModemAdp_Set_Apn_Info(MMI_Modem_Apn_Info_t *ApnInfo);

/**
 * This is used to set apn mode
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return void
 */
void MMI_ModemAdp_Set_Apn_Mode(MMI_MODEM_SIM_ID SimId);

/**
 * This is used to reset apn to default
 * param (in) void
 * return void
 */
void MMI_ModemAdp_Reset_Apn(void);

/**
 * This is used to config apn
 * param (in) Apn: char *
 * param (in) IpType: 0: IPV4V6;  1: IPV4;  2: IPV6
 * return void
 */
void MMI_ModemAdp_Config_Apn(char *Apn, UINT8 IpType);

/**
 * This is used to send SMS to operator to open VOLTE
 * param (in) SimId：MMI_MODEM_SIM_ID
 * return void
 */
void MMI_ModemAdp_Open_Volte_Req(MMI_MODEM_SIM_ID SimId);

/**
 * LTE power request
 * param (in) position: app_adaptor_lte_power_tx_req
 * param (in) option, channel, power
 * return void
*/
void app_adaptor_lte_power_tx_req(MMI_MODEM_SIM_ID sid, uint8_t option, uint8_t channel, uint8_t power);

/**
 * app_adaptor_get_lte_band_req
 * param (in)
 * return void
*/
void app_adaptor_get_lte_band_req(MMI_MODEM_SIM_ID sid, void *band_info);


#ifdef __cplusplus
}
#endif /* __cpluscplus */

#endif /* end of _MMI_MODEMADP_INTERFACE_H_ */
